package com.wyman;

import java.util.concurrent.ConcurrentHashMap;

public class BeanFactory {

    private ConcurrentHashMap<String,BeanDefinition> beanMap = new ConcurrentHashMap<>();


    public void registerBeanDefinition(String beanName,BeanDefinition beanDefinition){
        beanMap.put(beanName,beanDefinition);
    }

    public Object getBean(String beanName){
        return beanMap.get(beanName).getBean();
    }

}
